package textbasedapp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class ConsoleIO {

	public static void main(String[] args) {
		String s;
		InputStreamReader reader = new InputStreamReader(System.in);
		BufferedReader buff = new BufferedReader(reader);
		boolean running = true;
		while (running) {
			try {
				System.out.println("Please enter your lucky word:");
				s = buff.readLine();
				if (s.equals("WINNER")) {
					System.err.println("You are the million dollars winner.");
					running = false;
				}else{
					System.out.println("You missed it. See you next time.");
				}
			} catch (IOException e) {
				System.out.println("Your input has some errors.");
			}
		}
	}

}
